﻿<%@ Page Title="Bulletin" Language="C#" Culture="auto" UICulture="auto" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Bulletin.aspx.cs" Inherits="IFD2.Bulletin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline">
    <div class="container-fluid body-content" style="width:100%;">
    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control btn-primary input-sm text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click">
                <span class="glyphicon glyphicon-search" style="font-size:large;"></span>
            </asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>
        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="" style="color:white;">
                        <asp:Literal ID="Literal1" runat="server" Text="公告板" meta:resourcekey="tipPageTitle"></asp:Literal>
                    </h6>
                </div>
                <div class="panel-body">
                    <p><asp:Literal ID="litContent" runat="server"></asp:Literal></p>
                </div>
            </div>

            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="" style="color:white;">
                        <asp:Literal ID="Literal2" runat="server" Text="系统信息" meta:resourcekey="tipSysInfo"></asp:Literal>
                    </h6>
                </div>
                <div class="panel-body">
                    <asp:Label ID="Label2" runat="server" Text="Time:" meta:resourcekey="tipTime"></asp:Label>
                    <asp:Label ID="lblDbTime" runat="server" Font-Bold="True" ForeColor="Blue"></asp:Label><br />
                    <asp:Label ID="Label4" runat="server" Text="Caution:" meta:resourcekey="tipCaution" Font-Italic="true"></asp:Label>
                </div>
            </div>
            
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="" style="color:white;">
                        <asp:Literal ID="Literal3" runat="server" Text="登录信息" meta:resourcekey="tipLogonHistory"></asp:Literal>
                    </h6>
                </div>
                <div class="panel-body">
                    <asp:Label ID="lblWarning" runat="server" Text="warning" meta:resourcekey="tipWarning" Visible="false" Font-Bold="true" ForeColor="Red" ></asp:Label>
                    <%--<asp:Label ID="lblLastLogon" runat="server" Text="Label" Font-Bold="True" Font-Size="X-Large" ForeColor="Red"></asp:Label>--%>
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:1000px;width:100%;" class="table-hover"
                            DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time" meta:resourcekey="logon_time" DataFormatString="{0:yyyy-M-d HH:mm}"/>
                                <asp:TemplateField HeaderText="" ItemStyle-Width="25">
                                    <ItemTemplate>
                                        <%# Eval("ret_code").ToString()=="0"?"":"X" %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="ip_addr" HeaderText="ip_addr" SortExpression="ip_addr" meta:resourcekey="ip_addr" ItemStyle-Width="120"/>
                                <asp:TemplateField HeaderText="client info" meta:resourcekey="client_info">
                                    <ItemTemplate>
                                        <%# IFD2.Helpers.UserAgent.Parse(Eval("action_detail").ToString(),false) %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="action_detail" HeaderText="action_detail" SortExpression="action_detail" meta:resourcekey="action_detail" ItemStyle-ForeColor="Gray"/>
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <asp:Label ID="Label5" runat="server" Text="Caution:" meta:resourcekey="tipLogonNote" Font-Italic="true"></asp:Label><br /><br />
                    <asp:Label ID="Label3" runat="server" Text="IP:" meta:resourcekey="tipIP"></asp:Label>
                    <asp:Label ID="lblIP" runat="server" Font-Bold="true"></asp:Label><br />
                    <%--<asp:Label ID="Label6" runat="server" Text="IP:" meta:resourcekey="tipHostName"></asp:Label>
                    <asp:Label ID="lblHostName" runat="server" Font-Bold="true"></asp:Label><br />--%>
                    <asp:Label ID="Label8" runat="server" Text="IP:" meta:resourcekey="tipAgentInfo"></asp:Label>
                    <asp:Label ID="lblAgentInfo" runat="server" Font-Bold="true"></asp:Label><br />
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                        SelectCommand="bll_user_get_last_logons" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                        <SelectParameters>
                            <asp:SessionParameter Name="user" SessionField="USER" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </div>
            </div>
            
        </div>
    </div>
    </div>
        <asp:HiddenField ID="hidIsLogonShow" runat="server" />
    </form>

    <div class="modal fade" id="modWarning">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title"><span class="glyphicon glyphicon-exclamation-sign" style="font-size:x-large;"></span></h4>
          </div>
          <div class="modal-body">
            <p><asp:Label ID="Label6" runat="server" Text="warning" meta:resourcekey="tipWarning"></asp:Label></p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">
                <asp:Label ID="Label1" runat="server" Text="I know" meta:resourcekey="tipIKnow"></asp:Label></button>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <script type="text/javascript">
        $(document).ready(function () {
            if (document.getElementById('<%=lblWarning.ClientID%>') != null  //has warning
                && document.getElementById('<%=hidIsLogonShow.ClientID%>').value == '1')
                $('#modWarning').modal({ keyboard: true });
        })
    </script>
</asp:Content>
